﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace ForbiddenIsolation
{
    public partial class FormMain : Form
    {
        public FormMain()
        {
            InitializeComponent();
        }

        private void buttonHandle_Click(object sender, EventArgs e)
        {
            string text = textBoxOriginal.Text;
            StringBuilder sb = new StringBuilder(text.Length * 2);
            char replaceChar = (char)46;
            for (int i = 0; i < text.Length; i++)
            {
                sb.Append(text[i]);
                sb.Append(replaceChar);
            }
            textBoxNew.Text = sb.ToString().Replace("\r" + replaceChar + "\n" + replaceChar, "\r\n");
        }

        private void buttonPaste_Click(object sender, EventArgs e)
        {
            if (textBoxNew.Text == "")
            {
                return;
            }

            Clipboard.SetText(textBoxNew.Text);
            MessageBox.Show("已经粘帖到剪切板!");
        }
    }
}
